package com.example.blog1.mapper;

import com.example.blog1.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {
    @Select("select * from user where user_name=#{username}")
    UserInfo queryByName(String userName);

    @Select("select * from user where id=#{id}")
    UserInfo queryById(Integer id);

    @Insert("insert into user(user_name,password) values(#{userName},#{password})")
    Integer registry(@Param("userName") String userName, @Param("password") String password);
}
